/*require("ui.js")
 * */
var LoginUI = (function(){
    var id_ui = ".gameUI .loginUI";
    var id_login = ".loginUI #loginButton";
    var id_register = ".loginUI #registerButton";
    var id_id = "#name";
    var id_pass = "#pass";
    return {
        name:"LoginUI",
        hide:function(){
            addClassWithCheck(id_ui,"hide");
        },
        show:function(){
            removeClassWithCheck(id_ui,"hide");
        },
        onLogin:function(cb){
            $(id_login).click(function(){
                executeWhenEnable(id_login,cb);
            });
        },
        onRegister:function(){
            $(id_register).click(function(){
                executeWhenEnable(id_register,cb);
            });
        },
        getId:function(){
            return $(id_id).val();
        },
        getPass:function(){
            return $(id_pass).val();
        },
    }
})();

UISystem.registerUI(LoginUI.name,LoginUI);